<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="vueInside">
        <button-counter></button-counter>
        <!-- 驼峰在逻辑层命名时候，视图层依然必须使用—方式表示 -->
        <button-c></button-c>
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    // 全局组件
    Vue.component('button-counter', {
        data() {
            return {
                count: 0,
            }
        },
        template: `<div>
                    <button @click=clickNum>点击了{{count}}</button>
                    <button @click=clickNum>点击了{{count}}</button>
                </div>`,
        methods: {
            clickNum: function() {
                this.count++
            }
        },
    })
    Vue.component('buttonC', {
        data() {
            return {
                count: 0,
            }
        },
        template: `<div>
                    <button @click=clickNum>点击了{{count}}</button>
                    <button @click=clickNum>点击了{{count}}</button>
                </div>`,
        methods: {
            clickNum: function() {
                this.count++
            }
        },
    })
    var vueShili = new Vue({
        el: '#vueInside',

    })
</script>

</html>